package com.example.shop.common.dto.face;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 存放人脸识别结果
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class FaceRecognitionReturnResult {
    //人脸绑定的用户的唯一标识，这里我们用用户账户作为标识
    private String userId;
    //人脸识别结果的可信度
    private float confidence;

    public FaceRecognitionReturnResult(String userId, float confidence){
        if(userId==null || userId.isEmpty()){
            this.userId= null;
        }else{
            this.userId= userId;
        }
        this.confidence=confidence;
    }

    @Override
    public String toString() {
        return "FaceDTO{" +
                "userId=" + userId +
                ", confidence=" + confidence +
                '}';
    }
}
